﻿using System.Threading.Tasks;

namespace OmniKits.Extensions
{
    using NullGuard;

    [NullGuard(ValidationFlags.None)]
    public static class TaskExtensions
    {
        public static bool IsNotRunning<TTask>(this TTask task)
            where TTask : Task
        {
            return task == null || task.IsCompleted;
        }
        public static bool IsRunning<TTask>(this TTask task)
            where TTask : Task
        {
            return !task.IsNotRunning();
        }
    }
}
